import { exInputNumber, exSelect, exSwitch } from '@ve/common/components/extension'
export default {
  VERSION: '20220408',
  type: 'uiImgCard',
  name: '图片盒子',
  icon: 'image-2-line',
  extension: {
    showAuto: exSwitch('是否是像素盒子', true),
    autoHeight: exInputNumber('像素高度', 100, 1, 10000),
    boxHeight: exInputNumber('高度', 50, 1, 100),
    flexDer: exSelect('子组件排布方向', 'row', [
      {
        label: '横',
        value: 'row',
      },
      {
        label: '竖',
        value: 'col',
      },
    ]),
    justifyAlign: {
      type: 'exRadioGroup',
      name: '水平位置',
      value: 'start',
      list: [
        {
          label: '居左',
          value: 'start',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居右',
          value: 'end',
        },
      ],
    },
    itemsAlign: {
      type: 'exRadioGroup',
      name: '垂直方向',
      value: 'flex-start',
      list: [
        {
          label: '居上',
          value: 'flex-start',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居下',
          value: 'flex-end',
        },
      ],
    },
    padding: {
      type: 'exInputNumber',
      name: '内边距',
      value: 1,
      min: 0,
      max: 12,
    },
    justify: {
      type: 'exJustifySelect',
      name: '换行',
      value: 'flex-wrap',
    },
    shadow: {
      type: 'exShadowSelect',
      name: '盒阴影',
      value: 'shadow-none',
    },
    border: {
      type: 'exBorderSelect',
      name: '边框厚度',
      value: 'border-0',
    },
    rounded: {
      type: 'exRoundedSelect',
      name: '边框圆角',
      value: 'rounded-none',
    },
    bg: {
      type: 'exBgColorSelect',
      name: '背景颜色',
      value: 'bg-white',
    },
    labelText: {
      type: 'exInput',
      name: '标签',
      value: '',
    },
    labelPosition: {
      type: 'exRadioGroup',
      name: '标签位置',
      value: 'center',
      list: [
        {
          label: '居左',
          value: 'left',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居右',
          value: 'right',
        },
      ],
    },
    topMargin: {
      type: 'exInputNumber',
      name: '上外边距',
      value: 0,
    },
    rightMargin: {
      type: 'exInputNumber',
      name: '右外边距',
      value: 0,
    },
    bottomMargin: {
      type: 'exInputNumber',
      name: '下外边距',
      value: 0,
    },
    leftMargin: {
      type: 'exInputNumber',
      name: '左外边距',
      value: 0,
    },
    backgroundSize: exSelect('背景图片类型', 'contain', [
      {
        label: '宽高自适应缩放',
        value: 'contain',
      },
      {
        label: '铺满盒子',
        value: 'cover',
      },
    ]),
    backgroundImg: {
      type: 'exUpload',
      name: '背景图片',
      value: '',
    },
  },
  list: [],
}
